﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Details.aspx.vb" Inherits="WebApplication1.Details" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    

<br />
<div style="position: relative">
    <asp:DataList ID="DataList3" runat="server" DataSourceID="SqlDataSource1" Width="550px">
        <ItemTemplate>
        <p style="font-size: large; font-family: Algerian; color: #000000">
            Spirit Name: <br />
            <%# Eval("spiritName")%>  <br /><br />
            
            Price: <br />
            <%# Eval("spiritPrice")%> <br /><br />

            Percentage Alochol:<br />
            <%# Eval("percentageAlochol")%> <br /><br />

            Rating:
            <asp:Rating ID="rt_getRating" runat="server" EmptyStarCssClass="empty" FilledStarCssClass="smiley-done" StarCssClass="empty" 
                   WaitingStarCssClass="empty"  ReadOnly="True" CurrentRating='<%# Eval("ratingAverage") %>'>
            </asp:Rating><br /><br />
        </p>
        <p style="font-size: large; font-family: Algerian; color: #000000">
            Details:
        </p>
        <p style="font-size: medium; font-family: Algerian; color: #000000">
            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='<%# Eval("spiritName","http://en.wikipedia.org/wiki/{0}") %>'> <%# Eval("detail") %> </asp:HyperLink>
            
        </p>
        </ItemTemplate>
    </asp:DataList>
</div>
    



<div style="position : relative; left: 552px;  margin-top:-500px">
        <asp:DataList ID="DataList4" runat="server" DataSourceID="SqlDataSource1" Width="300px">
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" src='<%# Eval("picture") %>' Height="400" Width="360px" />
            </ItemTemplate>
        </asp:DataList>

</div>



        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
            ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
            SelectCommand="SELECT [ID], [spiritName], [spiritPrice], [percentageAlochol], [manufacturer], [producedIn], [manuWebsite], [picture], [ratingAverage], [diner_fkid], [uploadDate], [detail] FROM [SpiritRatingAverageView] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
            ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
            SelectCommand="SELECT [Tag], [ID] FROM [SpiritTagView] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

        <br />
   <br />


<div style="position: relative; left:600px;  font-size: medium; font-weight: bold; color: #0000FF">
    <asp:HyperLink ID="hpl_uploadUser" runat="server">
        
    Upload by:&nbsp; <asp:Label ID="lb_uploadName" runat="server" Text="Label"></asp:Label><br /> 
    Upload Time:&nbsp; <asp:Label ID="lb_uploadTime"
        runat="server" Text="Label"></asp:Label>

        </asp:HyperLink>
        <br /><br />
</div>

<div style="position: relative; left:600px;">
                <p style="font-size: larger; color: #000080; font-family: MingLiU-ExtB">
                Add Tags: <br />
                </p>
                Input New Tags(split by ,):<br /> <asp:TextBox ID="tb_newTags" runat="server"></asp:TextBox><br /><br /><asp:CheckBoxList ID="cbl_tags" runat="server" 
                    DataSourceID="SqlDataSource3" DataTextField="Tag" DataValueField="ID" 
                    RepeatColumns="3">
                </asp:CheckBoxList>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
                    ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
                    SelectCommand="SELECT [ID], [Tag] FROM [Tag]"></asp:SqlDataSource>
                <br />
                <asp:Button ID="btn_addTag" runat="server" Text="Add Tag" />
                <br />
                <br />
                

</div>



<div  style="position: relative; width:550px; top: -197px; left: 4px; margin-top: 0px;">
        Tag:<br />
        <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource4" 
            RepeatDirection="Horizontal" >
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Tag","SpiritListByTag.aspx?Tag={0}") %>' style="text-decoration:none "> 
                   &nbsp;&nbsp; &nbsp;&nbsp;
                   <asp:Label ID="TagLabel" runat="server" Text='<%# Eval("Tag") %>' />
                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </asp:HyperLink></ItemTemplate></asp:DataList><br /><br /><br />

                <asp:Button ID="tb_like" runat="server" Text="Like" Font-Bold="True" 
        Font-Italic="True" Font-Size="Medium" ForeColor="Red" />

    <asp:Button ID="btn_cancelLike" runat="server" Text="Cancel Like" Font-Bold="True" 
        Font-Italic="True" Font-Size="Medium" ForeColor="Red"/>


 <asp:Label ID="lb_countLike" runat="server" Text="Label" style="font-size: medium; font-weight: bold; color: #FF00FF; width:330px"></asp:Label><br /><br /><br /><br />

 
                                    <asp:Rating 
        ID="rt_userRating" runat="server" EmptyStarCssClass="empty" 
        FilledStarCssClass="smiley-done" StarCssClass="smiley" 
        WaitingStarCssClass="empty"></asp:Rating>
        <br /><br />
                    <asp:Button ID="btn_rating" runat="server" Text="Rating" />

<asp:Button 
        ID="btn_ratingUpdate" runat="server" Text="Give new Rating" Visible="False" style="position:absolute"/><br />

</div>
<br />
<br />
<br />
<br /><br /><br /><br />
<br /><br /><br /><br />
<br /><br /><br /><br />


<div>
        <p style="font-size: larger; color: #000080; font-family: MingLiU-ExtB">
        Add Comment: <br />
        </p>
        <p>
        Author:&nbsp;&nbsp;&nbsp; <asp:LoginName 
                    ID="ln_authorName" runat="server" /></p><p>
        Title:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:TextBox ID="tb_title" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            BackColor="Yellow" ControlToValidate="tb_title" Display="Dynamic" 
            ErrorMessage="Please enter the title" ForeColor="Red" ValidationGroup="group1"></asp:RequiredFieldValidator></p><p>
        Comment:</p><p>
        <asp:TextBox 
            ID="tb_comment" runat="server" Height="148px" TextMode="MultiLine" 
            Width="783px"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
            BackColor="Yellow" ControlToValidate="tb_comment" Display="Dynamic" 
            ErrorMessage="Please enter the comment" ForeColor="Red" 
                ValidationGroup="group1"></asp:RequiredFieldValidator></p><p>
        <asp:Button ID="btn_comment" runat="server" Text="Commit The Comment" 
                ValidationGroup="group1" />
        </p>  
</div>

<div style="position:relative; top: -738px; left: 6px;"><p style="font-size: medium; color: #0000FF; ">
    Comments </p><div style="overflow: auto; height:300px;"  >
    <asp:DataList ID="DataList2" 
            runat="server" DataSourceID="SqlDataSource2" Width="900px" CellPadding="4" 
            ForeColor="#333333"><AlternatingItemStyle BackColor="White" /><FooterStyle 
                BackColor="#990000" Font-Bold="True" ForeColor="White" /><HeaderStyle 
                BackColor="#990000" Font-Bold="True" ForeColor="White" /><ItemStyle 
                BackColor="#FFFBD6" ForeColor="#333333" /><ItemTemplate>
                    <div >
                        <div style="text-align:right; font-size:1.1em; font-style:italic;">
                        Time: <%# Eval("commentDate") %>. 
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("diner_fkid","ViewProfile.aspx?dinerID={0}") %>'>
                        <asp:Image src='<%# Eval("protrait") %>' ID="Image2" runat="server"  Height="50px" Width="50px" /> 
                        Author: <%# Eval("Author") %><br /></div><div style="font-size=1.1em; ">
                        </asp:HyperLink>Title: <%# Eval("Title")%><br /></div><br />Comment:<br /> <%# Eval("Comment")%><br /></div></ItemTemplate><SelectedItemStyle   BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /></asp:DataList>
 </div>
 <br />
 <br />
 <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
            ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
        SelectCommand="SELECT [ID], [Author], [Title], [Comment], [Spirit_fkid], [diner_fkid], [protrait], [commentDate] FROM [commentInculdeUserPictureView] WHERE ([Spirit_fkid] = ?) ORDER BY [commentDate] DESC"><SelectParameters>
                <asp:QueryStringParameter Name="Spirit_fkid" QueryStringField="ID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
</asp:Content>

